package com.trkj.usercenter.charts;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.trkj.base.Constants;
import com.trkj.base.utils.UserService;

import java.text.MessageFormat;

/**
 * 图表统计：部门学分排行
 * Created by LiZanhong on 2015/06/25.
 */
public class DetpRankFragment extends ChartFragment{
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        setChartUrl(Constants.ApiUrl.CHART_DEPT_RANK);
        setTitle("部门学分排行榜（单位：分）");
        setKey("user_name");
        setValue("points");

        super.onCreate(savedInstanceState);
    }

    @Override
    public String getUrl(){
        return MessageFormat.format(getChartUrl(),
                UserService.getInstance(this.getActivity()).parseUser().deptId
        );
    }
}
